package com.bwie.controller;

import com.bwie.param.UserParam;
import com.bwie.service.TbUserService;
import com.bwie.utils.R;
import com.bwie.vo.UserVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/user/index")
public class UserController {
    @Autowired
    private TbUserService tbUserService;

    /**
     * 手机号登录
     */
    @PostMapping("/login")
    public R login(@RequestBody UserVo userVo){
        return tbUserService.login(userVo);
    }
    /**
     * 发送验证码
     */
    @PostMapping("/sendCode/{userMobile}")
    public R sendCode(@PathVariable(name = "userMobile") String userMobile){
       return tbUserService.sendCode(userMobile);
    }
    /**
     * 用户列表
     */
    @PostMapping("getUserList")
    public R getUserList(@RequestBody UserParam userParam){
        return tbUserService.getUserList(userParam);
    }
    /**
     * 余额+
     */
    @PostMapping("/updateMoney/{userId}")
    public R updateMoney(@PathVariable(name = "userId")Integer userId){
        return tbUserService.updateMoney(userId);
    }
}
